from netfilterqueue import NetfilterQueue

from packet_correctness import *

packet_correctness = PacketCorrectness(None, 1, 'GatewayIn')

_pkt = b'E\x00\x00<\x00\x01\x00\x00@\x06\x11\xe5\xf7\x89\xe9\xcc$\x91b\xef\x8duM\xf1\x00\x00\x00\x00\x00\x00\x00' \
       b'\x00P\x02 \x00!\xca\x00\x00abcdefffffffffffffff'


def print_and_accept(pkt):
    # out_pkt = packet_correctness.generate(_pkt)  # generate
    # pkt.set_payload(out_pkt)
    pkt.accept()


queue = NetfilterQueue()
queue.bind(1, print_and_accept, max_len=8192 * 20)
try:
    queue.run()
except KeyboardInterrupt:
    queue.unbind()
